/**
 * Created by ss on 15/12/23.
 */
require("../less/index.less");
require("../img/button.png");
import $ from "jquery";
import Helper from "./modules/helper.js";
import render from "./modules/render.js";
$(function () {

    Helper.init();   //做一些简单的初始化操作

    var getParam = Helper.urlGet() ;
    var orderInfo = getParam.orderInfo ;

    Helper.ajax({
        url : "/order/getTeamOrderDetail",
        data : {
            orderInfo : orderInfo
        },
        type : "get",
        dataType: "json"
    }).then(function(orderInfoResult){
        var initData = {};

        if(orderInfoResult.code == 1){

            initData = orderInfoResult.data.orderDetail;
            initData.startTime = Helper.hackDate(initData.startDate);
            initData.endTime = Helper.hackDate(initData.endDate);
            var initDataCopy = $.extend({},initData);
            render.updatePrice(initDataCopy.startDate,initDataCopy.endDate,initDataCopy.orderId).then(function(inventor){
                initDataCopy.orderItems = render.mergePrice(initDataCopy.orderItems,inventor.data.list);
                render.init({
                    data : initDataCopy
                });
            })
        }

    })



})

